package com.xd.core.company.mapper;

import com.github.pagehelper.Page;
import com.xd.core.api.dto.CompanyAuthMobile3Dto;
import com.xd.core.api.dto.TowRechargeDto;
import com.xd.core.api.vo.BalanceVo;
import com.xd.core.api.vo.TowBalanceVo;
import com.xd.core.business.vo.OutBalanceVo;
import com.xd.core.company.dto.*;
import com.xd.core.company.entity.Company;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.xd.core.company.vo.*;
import com.xd.core.finance.entity.RechargeRecord;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.math.BigDecimal;
import java.util.List;

/**
 * <p>
 * 企业信息 Mapper 接口
 * </p>
 *
 * @author ZX
 * @since 2025-02-23
 */
public interface CompanyMapper extends BaseMapper<Company> {


    CompanyAuthMobile3Dto getCompanyAuthInfo(Integer companyId);

    List<CompanyPageVo> queryList(@Param("id") Integer id,
                                  @Param("companyQuery") CompanyQuery companyQuery);

    List<CompanyPageVo> queryList1(@Param("id") Integer id, @Param("companyQuery") CompanyQuery companyQuery);

    List<CapitalPageVo> getCapital(@Param("companyQuery") CompanyQuery companyQuery);

    CompanyCapitalVo getCapitalDetail(Integer id);

    List<AgencyListVo> getCapitalAgencyList(Integer id);

    ConfigureRatesVo getConfigureRates(Integer id);

    void updateBalance(BigDecimal balance, Integer companyId);

    List<Integer> selectAgencyCount(Integer companyId);

    @Select("select balance from  company where id = #{companyId} for update")
    BigDecimal selectBalance(Integer companyId);

    void updateRechargeAmount(Integer companyId, String amount);

    void updateOutAmount(Integer companyId, Long amount);

    void updateOutAmountFreeze(Integer companyId, Long amount);

    void updatete();

    void updateReturnAmount(long amount, Integer companyId);

    void updateIncomingStatus(UpdateIncomingStatus updateIncomingStatus);

    List<CompanyInfoVo> getCapitals();

    List<CompanyInfoVo> getAllCompany();

    List<CompanyInfoVo> getAgents(Integer companyId);

    void addBalance(RechargeRecord rechargeRecord);


    void updateContract(Integer companyId, String virtualPath);

    CompanyDetailVo getCapitalDetailPublic(Integer companyId);

    List<CompanyVo1> getCapitalsFinance(Integer companyId);

    BalanceVo selectAmount(String walletNo);

    OutBalanceVo selectOutAccountBalance(Integer companyId);

    CompanyAgencyVo getPassAgencyList(Integer companyId);

    ElectronicAccountsVo getAccountOpeningAuthentication(Integer companyId);

    void updateBusinessManager(Integer businessManager, Integer companyId);

    void reduceBalance(RechargeRecord rechargeRecord);

    void updateContractStatus(Integer companyId, String contractStatus);

    void updateOutAndBaofuBalance(Integer companyId, long amount);

    void updateBaofuBalance(Integer companyId, Long amount);

    void updateWithholdSwitchStatus(@Param("companyId") Integer companyId,@Param("withholdSwitch") String withholdSwitch);

    Page<BlocPageVo> getBlocList(BlocQuery query);

    CompanyBloc getBloc(Integer id);

    List<CompanyCapitals> getBlocCapitals(Integer id);

    List<CompanyInfoVo> getBlocCapital(Integer id);

    void updateCapaitalBlocName(@Param("companyId") Integer companyId,@Param("blocName") String blocName);

    List<CompanyVo1> getCapitalsFinance1();

    void towRecharge(TowRechargeDto towRechargeDto);

    void freezeBaofuBalance(Integer companyId, Long transMoney);

    void updateTowFreeze(Integer companyId, Long amount);

    void updateTowReturnAmount(long amount, Integer companyId);

    void updateThoroughFare(CompanyThoroughFare companyThoroughFare);

    List<CompanyInfoVo> getInsuranceCompanys();

    void updateTowReturnAmountFreeze(Integer companyId, long penny);

    void updateTowBaofuBalance(Integer companyId, Long amount);

    void updateTowReturnBalance(Integer companyId, Long amount);

    TowBalanceVo PTtowBalance();

    String getPayPassList(Integer companyId);

    List<CompanyInfoVo> getInsuranceCapitals();

    List<CompanyInfoVo> getInsuranceBlocCapital(Integer id);

    List<Integer> getBlocId();

    OutBalanceVo selectOutAccountBalanceTwo(Integer companyId);

    List<CompanyInfoVo> getCapiptalAgents(List<Integer> capitalCompanyIds);

    void updateRemark(CompanyRemark companyRemark);

    BigDecimal getTotalBaofuBalance();

    void updateFreezeAccount(FreezeAccountDto freezeAccountDto);

    void updateOpenStatus(UpdateOpenStatus updateOpenStatus);
}
